import request from '@/utils/request'

/***************************************************** customer ****************************************************/

/**
 * 获取列表
 * @returns 
 */
export const getAdminCustomerListApi: IGetAdminCustomerListApi = function(data) {
    return request.post(`htscrm/admin/customer`, data) as ReturnType<IGetAdminCustomerListApi>
}

/**
 * 获取详情
 * @returns 
 */
export const getAdminCustomerDetailApi: IGetAdminCustomerDetailApi = function(id) {
    return request.get(`htscrm/admin/user_info/${id}`, {}) as ReturnType<IGetAdminCustomerDetailApi>
}

/**
 * 编辑
 * @returns 
 */
export const updateAdminCustomerApi: IUpdateAdminCustomerApi = function(data) {
    return request.post(`htscrm/admin/kehuEdit`, data, { showErrorMessage: true }) as ReturnType<IUpdateAdminCustomerApi>
}

/**
 * 编辑
 * @returns 
 */
export const updateAdminCustomerStatusApi: IUpdateAdminCustomerApi = function(data) {
    return request.post(`htscrm/admin/setStatus`, data, { showErrorMessage: true }) as ReturnType<IUpdateAdminCustomerApi>
}

/**
 * 获取客户数据
 * @returns 
 */
export const getCustomerDataApi: IGetInfoApi = function(data) {
    return request.post(`htscrm/admin/kehuData`, data) as ReturnType<IGetInfoApi>
}